# -*- encoding: utf-8 -*-
'''
@File    :   run.py.py   
@Contact :   desufnocs@163.com
@des     :   fastapi项目运行
 
@Modify Time       @Author      @Version    @Desciption
------------      ----------    --------    -----------
2025/2/17 15:44   AssenImpact      1.0         None
'''

import uvicorn

import control.config as CONFIG
from control.core.Utils import show_window_message, save_log
from control.main import app

if __name__ == '__main__':
    logger = save_log()
    logger.info("FastAPI 服务器启动")
    try:
        uvicorn.run(app, host="0.0.0.0", port=CONFIG.PORT, reload=False, log_config=None)
    except:
        show_window_message("运行异常，请检查端口是否被占用")
